package org.duang.http.core;

public class ClientConfig {

	private String userAgent;
	private int maxConnections = 128;							//设置整个连接池最大连接数 根据自己的场景决定
	private int maxConnectionsPerRoute = 48;
	private int socketTimeout = 33*1000;					//设置等待数据超时时间 根据业务调整
	private int connectionTimeout = 30*1000;			//设置请求超时时间 根据业务调整
	private int maxErrorRetry = 3;								// 重试次数
	private String encode = "UTF-8";
	private int ioReactorThreadCount = Runtime.getRuntime().availableProcessors();
	private boolean soKeepAlive = true;		//
	private boolean exceptContinue = true;	//

	public boolean isExceptContinue() {
		return exceptContinue;
	}

	public boolean isSoKeepAlive() {
		return soKeepAlive;
	}

	public int getIoReactorThreadCount() {
		return ioReactorThreadCount;
	}

	public String getUserAgent() {
		if (null == userAgent || "".equals(userAgent)) {
			userAgent = "";
		}
		return userAgent;
	}

	public int getMaxConnections() {
		return maxConnections;
	}

	public int getMaxConnectionsPerRoute() {
		return maxConnectionsPerRoute;
	}

	public int getSocketTimeout() {
		return socketTimeout;
	}

	public int getConnectionTimeout() {
		return connectionTimeout;
	}

	public int getMaxErrorRetry() {
		return maxErrorRetry;
	}

	public String getEncode() {
		return encode;
	}

}
